home *** CD-ROM | disk | FTP | other *** search
- Path: news.dal.ca!news
- From: Klaus.Eichele@Dal.Ca (Klaus Eichele)
- Newsgroups: comp.lang.c++
- Subject: Re: Turbo 3.0 compiler bug -- I MEAN IT!!!!
- Date: Tue, 02 Apr 1996 17:05:09 GMT
- Organization: Dalhousie University
- Message-ID: <4jr8m7$kpm@News.Dal.Ca>
- References: <4jpp78$85b@news.vanderbilt.edu>
- NNTP-Posting-Host: rewasylishen.chem.dal.ca
- X-Newsreader: Forte Free Agent 1.0.82
-
- haseltbt@ctrvax.vanderbilt.edu (Bennett Haselton) wrote:
- > Hello world,
-
- > i've found what appears to be a bug in the Turbo 3.0 C++
- >compiler. Apparently if you write a while loop that is immediately preceded by
- >code identical to that contained in the while loop--and the "while" statement
- >is true at the time the code immediately preceding it is analyzed--then the
- >compiler ignores this extra code preceding the while loop as unnecessary.
- >Seems reasonable--equivalent output, right?
- > The problem is in the debugging process. i had written code with the
- >above-mentioned redundancy to make it easier to read, and in the debugging
- >cycle i tried setting breakpoints within the block of "redundant" code. Turbo
- >C++ will not allow breakpoints to be set at empty or commented space;
- >unfortunately the redundant code was compiled as "empty space" and breakpoints
- >were forbidden there. Worse, when the compiler skipped to a breakpoint inside
- >the while loop, it became obvious from the values of watch variables that the
- >redundant code had been skipped entirely.
- <SNIP>
-
- Hi, I don't think your discovery qualifies as a bug. For your
- particular problem, however, you might want to try to switch of
- optimization. Without optimization, you should get the result you
- expect.
-
- Good Luck,
- Klaus
-
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Klaus Eichele keichele@is.dal.ca
- http://is.dal.ca/~keichele/keichele.html
-
-